package com.stu.test.mapper;

import com.stu.test.dto.PageUtilDTO;
import com.stu.test.entity.Address;
import com.stu.test.vo.UserAndAddressVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * ClassName: IAddressMapper
 * Package: com.stu.test.mapper
 * Description: @Version 1.0
 */
public interface IAddressMapper {
//    在传参的时候用@Param("别名")，如果传参是对象类型则不需要
    Address getAddrById(@Param("id") int id);
    int addAddress(Address address);
    int deleteAddress(int id);
    int updateAddress(Address address);

    List<Address> getAddrByDynamic(Address address);
    int updateAddrByDynamic(Address address);
    int addAddrBatch(List<Address> addressList);
    int deleteAddrBatch(@Param("addressList") List<Integer> addressList);
    List<UserAndAddressVo> getAddrAndUser(int id);
    List<Address> getAddrPage(PageUtilDTO pageUtilDTO);
    List<Address> getAddrList();
}
